Skip to content

Misc#247

Merged
ako merged 4 commits intomainfrom
misc
Apr 21, 2026
Merged

Misc#247
ako merged 4 commits intomainfrom
misc

Conversation

@ako
Copy link
Copy Markdown
Collaborator

@ako ako commented Apr 21, 2026

No description provided.

ako and others added 4 commits April 21, 2026 15:43
…L examples

The initial lowercase conversion had several bugs:

- Widget builder used strings.ToUpper(w.Type) with lowercase case values,
  causing "unsupported widget type: layoutgrid/datagrid" at runtime. Fixed
  all ToUpper → ToLower in page builder, widget engine, and validation code.

- MDL example files had qualified identifiers after '.' incorrectly lowercased
  (System.Image → System.image, System.User → System.User, etc.) because the
  conversion script did not protect all identifier positions. Restored correct
  Mendix entity/role name casing.

- Business event attribute types (Long, String) stored as raw parser text were
  now lowercase. Added canonical casing map in dataTypeSimpleName() so the
  BSON always receives "Long", "String", etc. regardless of MDL input casing.

- publish/subscribe switch and objectType switches used ToUpper against
  lowercase case values. Fixed to ToLower throughout.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
More ToUpper-with-lowercase-cases bugs and hardcoded uppercase strings:

- Workflow properties: visitor hardcoded "DISPLAY", "EXPORT_LEVEL" etc. but
  mutator case values were already lowercase. Normalized all property strings
  (both hardcoded in visitor and remaining uppercase cases in mutator) to
  lowercase. Updated tests accordingly.

- Settings executor: strings.ToUpper(stmt.Section) with lowercase case values.
  Changed to ToLower; fixed "LANGUAGE" case and hardcoded "CONSTANT"/
  "CONFIGURATION" in visitor. Fixed MDL example (alter settings LANGUAGE).

- Entity event handlers: describe output used ToUpper for moment/event name.
  Changed to ToLower so output is "on before commit" not "on BEFORE COMMIT".

- REST client: method stored as BSON title case ("Get"), describe output needs
  strings.ToLower to produce "get" not "Get".

- Design properties: ON/OFF toggle values hardcoded as "ON"/"OFF" in visitor
  but switch used ToUpper with lowercase "on"/"off" cases. Fixed visitor to
  produce lowercase and switch to use ToLower.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Same ToUpper-with-lowercase-cases pattern in more files:

- visitor_rest.go: ResponseType and BodyType hardcoded as "JSON", "MAPPING"
  etc., while executor switches use lowercase "json", "mapping". Fixed all
  to lowercase; also "EXPORT_MAPPING" → "export_mapping" in executor.

- cmd_alter_workflow.go: "OVERVIEW_PAGE" and "TARGETING_MICROFLOW" cases
  still uppercase, causing SetPropertyWithEntity to never be called for
  overview_page (falling to default SetProperty which errored).

- cmd_settings.go: "LANGUAGE" case was still uppercase despite earlier fix.

- cmd_pages_builder_v3.go: ob.Direction sort used ToUpper("desc") == "desc"
  which is always false, so descending sort never worked. Fixed to ToLower.

- cmd_diff_mdl.go: log level output used ToUpper, producing "WARNING" in
  diff MDL. Fixed to ToLower.

- 12-styling-examples.mdl: URL {Task} didn't match page param $task. Fixed
  to {task}.

- roundtrip_doctype_test.go: Added CE3637 to known limitations for
  03-page-examples.mdl (gallery/dataview sibling scope, pre-existing issue
  masked by the earlier layoutgrid build failure).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… to lowercase

BSON parser (sdk/mpr/parser_rest.go) always returns uppercase ResponseType
and BodyType ("JSON", "NONE", "MAPPING" etc.). The describe switches in
cmd_rest_clients.go were using exact lowercase case matches, so every
response fell through to the "none" default.

Fixed by adding strings.ToLower() normalization on both the BodyType and
ResponseType switches so they accept values from both the BSON parser
(uppercase) and the MDL visitor (lowercase).

Also fixed BooleanConditionOutcome.GetName() in sdk/workflows/workflow.go
which returned "TRUE"/"FALSE" but workflow describe output and tests
expect lowercase "true"/"false".

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ako ako merged commit 4da5973 into main Apr 21, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant